package com.vr.xuecheng.content.controller;

import com.vr.xuecheng.content.model.vo.CoursePreviewVO;
import com.vr.xuecheng.content.service.impl.CoursePublishServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hzh
 * @date 2025/03/18
 * 课程公开控制器
 */
@Tag(name = "课程公开控制器")
@Slf4j
@RequestMapping("/open")
@RestController
@RequiredArgsConstructor
public class CourseOpenController {
    private final CoursePublishServiceImpl coursePublishService;

    @Operation(summary = "课程公开的查询接口")
    @GetMapping("/course/whole/{course-id}")
    public CoursePreviewVO getCoursePreviewInfo(@PathVariable("course-id")Long courseId) {
        return coursePublishService.getCoursePreviewInfo(courseId);
    }
}
